sp_helpfile


ALTER DATABASE CRP_VertexReturns SET RECOVERY SIMPLE;

ALTER DATABASE CRP_VertexReturns SET RECOVERY FULL;
BACKUP LOG CRP_VertexReturns To DISK='D:\backup\CRP_Vertex_LOG.bak'


USE CRP_VertexReturns;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE CRP_VertexReturns
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (CRP_VertexReturns_log, 100); 
GO
-- Reset the database recovery model.
ALTER DATABASE CRP_VertexReturns
SET RECOVERY FULL;
GO


SELECT name , size/128.0 as Total,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB
FROM sys.database_files;
